package vista;
import java.awt.BorderLayout;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;

import javax.swing.WindowConstants;
import bean.JTextFieldValidator;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class vArbitro extends javax.swing.JFrame {
	private JPanel panFondo;
	private JTextFieldValidator txtNombre;
	private JButton btnSalir;
	private JButton btnRegistrar;
	private JTextFieldValidator txtFecha;
	private JTextFieldValidator txtApellido;
	private JTextFieldValidator txtCedula;
	private JLabel lblFecha;
	private JLabel lblApellido;
	private JLabel lblNombre;
	private JLabel lblCedula;

	public vArbitro() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			this.setTitle("Registrar Arbitro");
			{
				panFondo = new JPanel();
				getContentPane().add(panFondo, BorderLayout.CENTER);
				panFondo.setPreferredSize(new java.awt.Dimension(496, 353));
				panFondo.setLayout(null);
				panFondo.setToolTipText("Registrar Arbitro");
				{
					lblCedula = new JLabel();
					panFondo.add(lblCedula);
					lblCedula.setText("Cedula:");
					lblCedula.setBounds(53, 75, 53, 16);
				}
				{
					lblNombre = new JLabel();
					panFondo.add(lblNombre);
					lblNombre.setText("Nombre:");
					lblNombre.setBounds(53, 113, 53, 18);
				}
				{
					lblApellido = new JLabel();
					panFondo.add(lblApellido);
					lblApellido.setText("Apellido:");
					lblApellido.setBounds(53, 151, 47, 16);
				}
				{
					lblFecha = new JLabel();
					panFondo.add(lblFecha);
					lblFecha.setText("Fecha de Nacimiento:");
					lblFecha.setBounds(53, 191, 120, 16);
				}
				{
					txtCedula = new JTextFieldValidator(8, JTextFieldValidator.SOLO_NUMEROS);
					panFondo.add(txtCedula);
					txtCedula.setBounds(129, 72, 125, 23);
				}
				{
					txtNombre = new JTextFieldValidator(20, JTextFieldValidator.SOLO_LETRAS);
					panFondo.add(txtNombre);
					txtNombre.setBounds(129, 113, 189, 23);
				}
				{
					txtApellido = new JTextFieldValidator(20, JTextFieldValidator.SOLO_LETRAS);
					panFondo.add(txtApellido);
					txtApellido.setBounds(129, 148, 189, 23);
				}
				{
					txtFecha = new JTextFieldValidator(10, JTextFieldValidator.NUMERO_Y_SLASH);
					panFondo.add(txtFecha);
					txtFecha.setBounds(179, 188, 80, 23);
				}
				{
					btnRegistrar = new JButton();
					panFondo.add(btnRegistrar);
					btnRegistrar.setText("Registrar");
					btnRegistrar.setBounds(161, 251, 107, 23);
				}
				{
					btnSalir = new JButton();
					panFondo.add(btnSalir);
					btnSalir.setText("Salir");
					btnSalir.setBounds(374, 251, 81, 23);
				}
			}
			pack();
			this.setSize(618, 387);
		} catch (Exception e) {
		    //add your error handling code here
			e.printStackTrace();
		}
	}

	public String getTxtNombre() {
		return txtNombre.getText();
	}


	public String getTxtFecha() {
		return txtFecha.getText();
	}

	public String getTxtApellido() {
		return txtApellido.getText();
	}


	public String getTxtCedula() {
		return txtCedula.getText();
	}

	
	public void agregarActionListener(ActionListener accion){
		btnRegistrar.addActionListener(accion);
		btnSalir.addActionListener(accion);
	}
	
	public void mostrarMensaje(String mensaje) {
		JOptionPane.showMessageDialog(this, mensaje); 
	}
	
	public void limpiarCajas(){
		txtCedula.setText("");
		txtNombre.setText("");
		txtFecha.setText("");
		txtApellido.setText("");
	}
	

}
